  <!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>学生信息列表</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <script src="../bootstrap/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<div id="container" style="width:900px">


    <div id="menu" style="background-color:#FFD700;height:200px;width:100px;float:left;">
        <nav class="navbar bg-light">
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a class="nav-link" href="../Student/list.do">学生</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="../Teacher/list.do">教师</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="../Course/list.do">课程</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="../Score/list.do">成绩</a>
                </li>
            </ul>
        </nav></div>


    <div id="content" style="background-color:#EEEEEE;height:200px;width:800px;float:left;">
    <table class="table table-striped">
        <thead>
        <tr>
            <th>id</th>
            <th>name</th>
            <th>password</th>
            <th>性别</th>
            <th>班级</th>
            <th>生日</th>
            <th></th>
            <th> 成绩</th>
            <th>编辑</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="student:${students}">
            <td th:text="${student.id}"/>
            <td th:text="${student.name}"/>
            <td th:text="${student.password}"/>
            <td th:text="${student.sex==1?'男':'女'}"/>
            <td th:text="${student.clazz}"/>
            <td th:text="${student.birthday}"/>
            <td>
            <td >
                <div th:each="studentScore:${student.scores}">
                    <span  th:text="${studentScore.course.name}"/>
                    <span  th:text="${studentScore.score}"/>
                </div>
            </td>
            <td ><a th:href="@{delete.do(id=${student.id})}">删除</a>
                <a th:href="@{toUpdate.do(id=${student.id})}">修改</a>
            </td>
        </tr>
        </tbody>
    </table>
        <nav aria-label="Page navigation example">
            <ul class="pagination">
                <li class="page-item"><a class="page-link" th:href="@{/Student/list.do(currPage=(${currPage}-1),pageSize=3)}">Previous</a></li>
                <li class="page-item"><a class="page-link" th:href="@{/Student/list.do?currPage=1&pageSize=3}">1</a></li>
                <li class="page-item"><a class="page-link" th:href="@{/Student/list.do?currPage=2&pageSize=3}">2</a></li>
                <li class="page-item"><a class="page-link" th:href="@{/Student/list.do?currPage=3&pageSize=3}">3</a></li>
                <li class="page-item"><a class="page-link" th:href="@{/Student/list.do(currPage=(${currPage}+1),pageSize=3)}">next</a></li>
            </ul>
        </nav>
<a href="../Product/getPage.do?page=addStudent">return to 新增学生</a>
</div>
</body>


</html>